package org.tksj.bim.listener;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.tksj.bim.common.constant.Constants;
import org.tksj.bim.common.mq.MqConsumer;
import org.tksj.bim.common.thing.ThingModelMessage;

import javax.annotation.PostConstruct;

/**
 * @author luyongqiang
 */


@Service
public class TestListener {

	@Autowired
	private MqConsumer<ThingModelMessage> mqConsumer;
	@PostConstruct
	private  void  init(){

		mqConsumer.consume(Constants.THING_MODEL_MESSAGE_TOPIC, msg -> {

			System.out.println("收到消息:"+msg.getDeviceName());

		});
	}
}
